home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / ToolUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  3.2 KB  |  173 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        ToolUtils.h
  3.  
  4.      Contains:    Toolbox Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1990-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __TOOLUTILS__
  18. #define __TOOLUTILS__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __OSUTILS__
  25.     #include <OSUtils.h>
  26. #endif
  27.  
  28.  
  29. #ifndef __FIXMATH__
  30.     #include <FixMath.h>
  31. #endif
  32.  
  33. #ifndef __ICONS__
  34.     #include <Icons.h>
  35. #endif
  36.  
  37. #ifndef __QUICKDRAW__
  38.     #include <Quickdraw.h>
  39. #endif
  40.  
  41. #ifndef __TEXTUTILS__
  42.     #include <TextUtils.h>
  43. #endif
  44.  
  45.  
  46.  
  47.  
  48. #if PRAGMA_ONCE
  49. #pragma once
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. #if PRAGMA_IMPORT
  57. #pragma import on
  58. #endif
  59.  
  60. #if PRAGMA_STRUCT_ALIGN
  61.     #pragma options align=mac68k
  62. #elif PRAGMA_STRUCT_PACKPUSH
  63.     #pragma pack(push, 2)
  64. #elif PRAGMA_STRUCT_PACK
  65.     #pragma pack(2)
  66. #endif
  67.  
  68. /*
  69. ------------------------------------------------------------------------------------
  70.     Note: 
  71.     
  72.     The following routines that used to be in this header file, have moved to
  73.     more appropriate headers.  
  74.     
  75.         FixMath.h:        FixMul
  76.                         FixRatio
  77.                         FixRound
  78.         
  79.         Icons.h:          GetIcon
  80.                         PlotIcon
  81.                         
  82.         Quickdraw.h:    AngleFromSlope
  83.                         DeltaPoint
  84.                         GetCursor
  85.                         GetIndPattern
  86.                         GetPattern
  87.                         GetPicture
  88.                         PackBits
  89.                         ScreenRes
  90.                         ShieldCursor
  91.                         SlopeFromAngle
  92.                         UnpackBits
  93.                         
  94.         TextUtils.h:    Munger
  95.                         GetIndString
  96.                         GetString
  97.                         NewString
  98.                         SetString
  99. ------------------------------------------------------------------------------------
  100. */
  101.  
  102. EXTERN_API( Boolean )
  103. BitTst                            (const void *            bytePtr,
  104.                                  long                     bitNum)                                ONEWORDINLINE(0xA85D);
  105.  
  106. EXTERN_API( void )
  107. BitSet                            (void *                    bytePtr,
  108.                                  long                     bitNum)                                ONEWORDINLINE(0xA85E);
  109.  
  110. EXTERN_API( void )
  111. BitClr                            (void *                    bytePtr,
  112.                                  long                     bitNum)                                ONEWORDINLINE(0xA85F);
  113.  
  114. EXTERN_API( long )
  115. BitAnd                            (long                     value1,
  116.                                  long                     value2)                                ONEWORDINLINE(0xA858);
  117.  
  118. EXTERN_API( long )
  119. BitOr                            (long                     value1,
  120.                                  long                     value2)                                ONEWORDINLINE(0xA85B);
  121.  
  122. EXTERN_API( long )
  123. BitXor                            (long                     value1,
  124.                                  long                     value2)                                ONEWORDINLINE(0xA859);
  125.  
  126. EXTERN_API( long )
  127. BitNot                            (long                     value)                                ONEWORDINLINE(0xA85A);
  128.  
  129. EXTERN_API( long )
  130. BitShift                        (long                     value,
  131.                                  short                     count)                                ONEWORDINLINE(0xA85C);
  132.  
  133. #if TARGET_CPU_68K
  134.  
  135. struct Int64Bit {
  136.     SInt32                             hiLong;
  137.     UInt32                             loLong;
  138. };
  139. typedef struct Int64Bit                    Int64Bit;
  140. EXTERN_API( void )
  141. LongMul                            (long                     a,
  142.                                  long                     b,
  143.                                  Int64Bit *                result)                                ONEWORDINLINE(0xA867);
  144.  
  145. #else
  146.     #define LongMul(a, b, result) ((void) WideMultiply((a), (b), (wide*)(result)))
  147. #endif  /* TARGET_CPU_68K */
  148.  
  149. #define HiWord(x) ((short)((long)(x) >> 16))
  150. #define LoWord(x) ((short)(x))
  151.  
  152.  
  153. #if PRAGMA_STRUCT_ALIGN
  154.     #pragma options align=reset
  155. #elif PRAGMA_STRUCT_PACKPUSH
  156.     #pragma pack(pop)
  157. #elif PRAGMA_STRUCT_PACK
  158.     #pragma pack()
  159. #endif
  160.  
  161. #ifdef PRAGMA_IMPORT_OFF
  162. #pragma import off
  163. #elif PRAGMA_IMPORT
  164. #pragma import reset
  165. #endif
  166.  
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170.  
  171. #endif /* __TOOLUTILS__ */
  172.  
  173.